﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CaffeeBuzz_WinForm.Template
{
    public abstract class ProgramFrame
    {
        protected abstract void StartMessage();
        protected abstract void Input();
        protected abstract bool ValidData();
        protected abstract void ErrorMessage();
        protected abstract void OutputMessage();
        protected abstract void Processing();
        protected abstract bool AskToContinue();
        public void Run()
        {
            bool toContinue = true;
            StartMessage();
            do
            {
                Input();
                if (!ValidData())
                {
                    ErrorMessage();
                    continue;
                }
                Processing();
                OutputMessage();
                toContinue = AskToContinue();
            }
            while (toContinue);
        }
    }
}
